import 'dart:ui';
import 'package:flustars_flutter3/flustars_flutter3.dart';
import 'package:flutter/material.dart';
import 'package:ls_work/a_yyt/models/gean_entity.dart';
import 'package:ls_work/a_yyt/page/ge_an_detail_page.dart';
import 'package:ls_work/res/styles.dart';
import 'package:ls_work/util/app_navigator.dart';

class GeAnCell extends StatelessWidget {
  final GeAnInfo? info;
  final int? type;
  GeAnCell({Key? key, this.info, this.type});
  @override
  Widget build(BuildContext context) {
    String elderName = info?.caption?.customerElderId != null
        ? info?.caption?.customerElderId??""
        : '';
    String statusStr = '';
    switch (info?.bean?.status) {
      case 0:
        statusStr = '待处理';
        break;
      case 1:
        statusStr = '待审核';
        break;
      case 2:
        statusStr = '已驳回';
        break;
      case 3:
        statusStr = '已完成';
        break;
      default:
    }
    return InkWell(
      onTap: () {
        AppNavigator.push(
          context,
          GeAnDetailPage(
            id: info?.bean?.id,
            type: type,
          ),
        );
      },
      child: Container(
          width: ScreenUtil.getScreenW(context),
          padding: EdgeInsets.all(12),
          child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      '$elderName',
                      style: TextStyles.textDark18,
                    ),
                    SizedBox(
                      width: 20,
                    ),
                    Expanded(
                      child: Text(
                        '${info?.bean?.bedNo ?? ''}',
                        style: TextStyles.textGray14,
                      ),
                    ),
                    Container(
                      padding: EdgeInsets.all(5),
                      alignment: Alignment.center,
                      decoration: BoxDecoration(
                          color: Colors.grey,
                          borderRadius: BorderRadius.circular(3)),
                      child: Text(
                        '$statusStr',
                        style: TextStyle(color: Colors.white, fontSize: 16),
                      ),
                    )
                  ],
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  '发起原因：${info?.bean?.reason ?? ''}',
                  style: TextStyles.textNormal16,
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  '发起人：${info?.caption?.createdBy}',
                  style: TextStyles.textNormal16,
                ),
                SizedBox(
                  height: 10,
                ),
                Text(
                  '发起时间：${info?.bean?.createdDate}',
                  style: TextStyles.textNormal16,
                ),
                SizedBox(
                  height: 10,
                ),
                // Text(
                //   '参与人员：张晓晓，李某某，李东东',
                //   style: TextStyles.textNormal16,
                // ),
                // SizedBox(
                //   height: 10,
                // ),
                // Text(
                //   '附件：',
                //   style: TextStyles.textNormal16,
                // ),
                // SizedBox(
                //   height: 10,
                // ),
                // Container(
                //   width: 100,
                //   height: 100,
                //   decoration: BoxDecoration(
                //     color: Colours.bg_color,
                //     borderRadius: BorderRadius.circular(5),
                //   ),
                // ),
                // SizedBox(
                //   height: 20,
                // ),
                // Text(
                //   '处理记录',
                //   style: TextStyles.textBoldDark16,
                // ),
                // SizedBox(
                //   height: 30,
                // ),
              ])),
    );
  }
}
